#!/usr/local/python37/bin/python3
"""
课堂练习(哈哈)
"""

def is_happy(num):
    """判断一个正整数是不是完美数"""
    temp = set()
    while num != 1:
        total = 0
        while num > 0:
            last = num % 10
            total += last ** 2
            num //= 10
        if total in temp:
            return False
        temp.add(total)
        num = total
     return True


  def main():
    """主函数(程序入口)"""
    for num in range(1, 101):
        print(f'{num}: {is_happy(num)}')
